package com.pcj.blog.web;/**
 * @param
 * @author pcj
 * @date 2022/1/7 14:54
 * @return
 */

import com.pcj.blog.service.BlogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

/**
 *
 * @className ArchivesController
 * @author pengcj
 * @date 2022/1/7 14:54
 */
@Controller
public class ArchivesController {
    @Autowired
    private BlogService blogService;
    @GetMapping("/archives")
    public String archives(Model model){
        model.addAttribute("archives",blogService.archiveBlog());
        model.addAttribute("blogcount",blogService.countBlog());
        return "archives";
    }
}
